package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosActionDispatchMapper;
import com.ruoyi.net.domain.ElementQosActionDispatch;
import com.ruoyi.net.service.IElementQosActionDispatchService;

/**
 * 网元-QOS配置-流行为-调度策略Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosActionDispatchServiceImpl implements IElementQosActionDispatchService 
{
    @Autowired
    private ElementQosActionDispatchMapper elementQosActionDispatchMapper;

    /**
     * 查询网元-QOS配置-流行为-调度策略
     * 
     * @param id 网元-QOS配置-流行为-调度策略主键
     * @return 网元-QOS配置-流行为-调度策略
     */
    @Override
    public ElementQosActionDispatch selectElementQosActionDispatchById(String id)
    {
        return elementQosActionDispatchMapper.selectElementQosActionDispatchById(id);
    }

    /**
     * 查询网元-QOS配置-流行为-调度策略列表
     * 
     * @param elementQosActionDispatch 网元-QOS配置-流行为-调度策略
     * @return 网元-QOS配置-流行为-调度策略
     */
    @Override
    public List<ElementQosActionDispatch> selectElementQosActionDispatchList(ElementQosActionDispatch elementQosActionDispatch)
    {
        return elementQosActionDispatchMapper.selectElementQosActionDispatchList(elementQosActionDispatch);
    }

    /**
     * 新增网元-QOS配置-流行为-调度策略
     * 
     * @param elementQosActionDispatch 网元-QOS配置-流行为-调度策略
     * @return 结果
     */
    @Override
    public int insertElementQosActionDispatch(ElementQosActionDispatch elementQosActionDispatch)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosActionDispatch.getId())) {
            elementQosActionDispatch.setId(uuid);
        }
        elementQosActionDispatch.setCreateBy(SecurityUtils.getUsername());
        elementQosActionDispatch.setCreateTime(DateUtils.getNowDate());
        elementQosActionDispatch.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionDispatch.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionDispatchMapper.insertElementQosActionDispatch(elementQosActionDispatch);
    }

    /**
     * 修改网元-QOS配置-流行为-调度策略
     * 
     * @param elementQosActionDispatch 网元-QOS配置-流行为-调度策略
     * @return 结果
     */
    @Override
    public int updateElementQosActionDispatch(ElementQosActionDispatch elementQosActionDispatch)
    {
        elementQosActionDispatch.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionDispatch.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionDispatchMapper.updateElementQosActionDispatch(elementQosActionDispatch);
    }

    /**
     * 批量删除网元-QOS配置-流行为-调度策略
     * 
     * @param ids 需要删除的网元-QOS配置-流行为-调度策略主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionDispatchByIds(String[] ids)
    {
        return elementQosActionDispatchMapper.deleteElementQosActionDispatchByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流行为-调度策略信息
     * 
     * @param id 网元-QOS配置-流行为-调度策略主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionDispatchById(String id)
    {
        return elementQosActionDispatchMapper.deleteElementQosActionDispatchById(id);
    }
}
